import server from "@/utils/request"

// 获取验证码
export const getServerList = () => {
    return server.get('/auth/code')
}

// 登录
export const getAuthLogin = (param: {
    code: string;
    password: string;
    username: string;
    uuid: string;
}) => {
    return server.post('/auth/login', param)
}

// 获取活动信息
export const activateList = (param: {
    serverId: number | string;
    runStatus: string | number;
}) => {
    return server.get('/api/pokerActivateInfo/activateList', { params: param })
}

// 获取活二动信息
export const activateListKing = (param: {
    serverId: number | string;
    runStatus: string | number;
}) => {
    return server.get('/api/pokerActivateInfo/activateListKing', { params: param })
}

// 新玩家加入活动
export const pokerUserActivatInfoJ = (param: {
    taskId: string;
    activateId: string;
}) => {
    return server.post('/api/pokerUserActivatInfo/j', null, { params: param })
}

// 获取活动一详情
export const pokerUserActivatInfoI = (param: {
    taskId: string;
    activateId: string;
}) => {
    return server.get('/api/pokerUserActivatInfo/i', { params: param })
}

// 获取活动二详情
export const pokerUserActivatInfoIKing = (param: {
    activateId: string;
}) => {
    return server.get('/api/pokerUserActivatInfo/iKing', { params: param })
}

// 获取活动奖励列表
export const pokerAwardList = (param: {
    serverId: number;
}) => {
    return server.get('/api/pokerAward/award', { params: param })
}

// 玩家领取奖励
export const pokerAwardS = (param: any) => {
    return server.post('/api/pokerAward/s', null, { params: param })
}

// 获取物品信息
export const pokerGoodInfo = () => {
    return server.get('/api/pokerGoodInfo/listGood')
}

// 物品兑换便便
export const pokerAwardWtq = (param:any) => {
    return server.post('/api/pokerAward/wtq', null, { params: param })
}

// 便便兑换物品
export const pokerAwardQtw = (param: any) => {
    return server.post('/api/pokerAward/qtw', null, { params: param })
}

// 换牌操作
export const pokerUserActivatInfoC = (param: {
    taskId: string | number;
    activateId: string | number;
    cardNum?: number;
    type: number;
}) => {
    return server.post('/api/pokerUserActivatInfo/c', null, { params: param })
}

// 玩家用户详情
export const getUser = (param: any) => {
    return server.get('/api/users/getUser', { params: param })
}

// 无需传参，用户信息
export const userById = () => {
    return server.get('/api/users/userById')
}


// 修改密码
export const updatePass = (data: {
    oldPass: string;
    newPass: string;
}) => {
    return server.post('/api/users/updatePass', data)
}

// 获取排名
export const pokerActivateAwardInfo = (param: {
    activateId: number | string;
}) => {
    return server.get('/api/pokerActivateAwardInfo', { params: param })
}

// 活动二，加入战队
export const selectGroup = (param: {
    activateId: number | string;
    groupId: number | string;
}) => {
    return server.post('/api/pokerUserActivatInfo/selectGroup', null, { params: param })
}

// 投票
export const doVote = (param: {
    activateId: number | string;
    groupId: number | string;
    bianbianVal: number;
}) => {
    return server.post('/api/pokerUserActivatInfo/doVote', null, { params: param })
}

export const listNotice = () => {
    return server.get('/api/noticeConfig/listNotice')
}

export const botUserAdd = (data: {
    steamId: string; 
    username: string; 
    nickName: string; 
    email: string; 
    phone: string; 
}) => {
    return server.post('/api/users/botUserAdd', data)
}